import { createApp } from 'vue'
// 初始化样式
import './assets/less/index.less'
import App from './App.vue'
// 路由
import router from './router/index.js' 
// pinia仓库
import {createPinia} from 'pinia'
// 持久化存储插件
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

// 全局引入封装的请求
import api from './api/api.js'

// 引入mock
import './api/mock.js'

const pinia=createPinia()

// 完整引入 elementplus
// import ElementPlus from 'element-plus'
// import 'element-plus/dist/index.css'

//elementplus icons图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app=createApp(App)


for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

// 全局引入封装的请求
app.config.globalProperties.$api=api
  
pinia.use(piniaPluginPersistedstate)

// 使用elementplus
// app.use(ElementPlus)
//使用路由
app.use(router)
app.use(pinia)
app.mount('#app')
